<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <script>
            //数据代理：一个对象代理另一个对象对属性的操作(读或写)
            let obj = {a:100};
            let obj2 = {b:200};
            Object.defineProperty(obj2,"a",{
                get(){
                    return obj.a;
                },
                set(value){
                    obj.a = value;
                }

            })
        </script>
    </body>
</html>